#include "train.h"
#include "client.h"
//发送小火车包含指令字符串，指令类型
int sends(int sockfd, train_t *train, int type, const char *request){
    train.type = type;
    train.lenth = strlen(request);
    strcpy(train.value, request);
    int ret = send(sockfd, &train, sizeof(int) + sizeof(int) + train.lenth, MSG_NOSIGNAL);
    if(ret == -1){
        return -1;
    }
    return 0; 
}
